package com.kakarote.core.exception;

import com.kakarote.core.common.ResultCode;
import com.kakarote.core.common.enums.SystemCodeEnum;
import com.kakarote.core.entity.UserExtraInfo;
import lombok.Getter;

/**
 * 用户尚未登陆
 *
 * @author zhangzhiwei
 */
@Getter
public class NoLoginException extends CrmException {

    public NoLoginException() {
        this(SystemCodeEnum.SYSTEM_NOT_LOGIN, null);
    }

    public NoLoginException(UserExtraInfo info) {
        this(SystemCodeEnum.SYSTEM_NOT_LOGIN, info);
    }

    public NoLoginException(ResultCode resultCode, UserExtraInfo info) {
        super(resultCode);
        setData(info);
    }

    public UserExtraInfo getInfo() {
        return (UserExtraInfo) getData();
    }
}
